- Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathAsyncCollectionRequestMessage`1.xml
234 lines (234 loc) · 14.8 KB
/
AsyncCollectionRequestMessage`1.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<TypeName="AsyncCollectionRequestMessage<T>"FullName="CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage<T>">
<TypeSignatureLanguage="C#"Value="public class AsyncCollectionRequestMessage<T> : System.Collections.Generic.IAsyncEnumerable<T>" />
<TypeSignatureLanguage="ILAsm"Value=".class public auto ansi beforefieldinit AsyncCollectionRequestMessage`1<T> extends System.Object implements class System.Collections.Generic.IAsyncEnumerable`1<!T>" />
<TypeSignatureLanguage="DocId"Value="T:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1" />
<TypeSignatureLanguage="VB.NET"Value="Public Class AsyncCollectionRequestMessage(Of T)
Implements IAsyncEnumerable(Of T)" />
<TypeSignatureLanguage="F#"Value="type AsyncCollectionRequestMessage<'T> = class
 interface IAsyncEnumerable<'T>" />
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
<TypeParameterName="T" />
</TypeParameters>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Collections.Generic.IAsyncEnumerable<T></InterfaceName>
</Interface>
</Interfaces>
<Docs>
<typeparamname="T">The type of request to make.</typeparam>
<summary>
A <seelangword="class" /> for request messages that can receive multiple replies, which can either be used directly or through derived classes.
</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<MemberMemberName=".ctor">
<MemberSignatureLanguage="C#"Value="public AsyncCollectionRequestMessage ();" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignatureLanguage="DocId"Value="M:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1.#ctor" />
<MemberSignatureLanguage="VB.NET"Value="Public Sub New ()" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberMemberName="CancellationToken">
<MemberSignatureLanguage="C#"Value="public System.Threading.CancellationToken CancellationToken { get; }" />
<MemberSignatureLanguage="ILAsm"Value=".property instance valuetype System.Threading.CancellationToken CancellationToken" />
<MemberSignatureLanguage="DocId"Value="P:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1.CancellationToken" />
<MemberSignatureLanguage="VB.NET"Value="Public ReadOnly Property CancellationToken As CancellationToken" />
<MemberSignatureLanguage="F#"Value="member this.CancellationToken : System.Threading.CancellationToken"Usage="CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage<'T>.CancellationToken" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.CancellationToken</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets the <seecref="T:System.Threading.CancellationToken" /> instance that will be linked to the
one used to asynchronously enumerate the received responses. This can be used to cancel asynchronous
replies that are still being processed, if no new items are needed from this request message.
Consider the following example, where we define a message to retrieve the currently opened documents:
<code>
public class OpenDocumentsRequestMessage : AsyncCollectionRequestMessage<XmlDocument> { }
</code>
We can then request and enumerate the results like so:
<code>
await foreach (var document in Messenger.Default.Send<OpenDocumentsRequestMessage>())
{
// Process each document here...
}
</code>
If we also want to control the cancellation of the token passed to each subscriber to the message,
we can do so by passing a token we control to the returned message before starting the enumeration
(<seecref="M:System.Threading.Tasks.TaskAsyncEnumerableExtensions.WithCancellation``1(System.Collections.Generic.IAsyncEnumerable{``0},System.Threading.CancellationToken)" />).
The previous snippet with this additional change looks as follows:
<code>
await foreach (var document in Messenger.Default.Send<OpenDocumentsRequestMessage>().WithCancellation(cts.Token))
{
// Process each document here...
}
</code>
When no more new items are needed (or for any other reason depending on the situation), the token
passed to the enumerator can be canceled (by calling <seecref="M:System.Threading.CancellationTokenSource.Cancel" />),
and that will also notify the remaining tasks in the request message. The token exposed by the message
itself will automatically be linked and canceled with the one passed to the enumerator.
</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberMemberName="GetAsyncEnumerator">
<MemberSignatureLanguage="C#"Value="public System.Collections.Generic.IAsyncEnumerator<T> GetAsyncEnumerator (System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IAsyncEnumerator`1<!T> GetAsyncEnumerator(valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignatureLanguage="DocId"Value="M:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1.GetAsyncEnumerator(System.Threading.CancellationToken)" />
<MemberSignatureLanguage="VB.NET"Value="Public Function GetAsyncEnumerator (Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerator(Of T)" />
<MemberSignatureLanguage="F#"Value="abstract member GetAsyncEnumerator : System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerator<'T>
override this.GetAsyncEnumerator : System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerator<'T>"Usage="asyncCollectionRequestMessage.GetAsyncEnumerator cancellationToken" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.Generic.IAsyncEnumerable`1.GetAsyncEnumerator(System.Threading.CancellationToken)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeNameLanguage="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeNameLanguage="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeNameLanguage="C#">[System.Runtime.CompilerServices.AsyncIteratorStateMachine(typeof(CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage<>+<GetAsyncEnumerator>d__8))]</AttributeName>
<AttributeNameLanguage="F#">[<System.Runtime.CompilerServices.AsyncIteratorStateMachine(typeof(CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage<>+<GetAsyncEnumerator>d__8))>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IAsyncEnumerator<T></ReturnType>
</ReturnValue>
<Parameters>
<ParameterName="cancellationToken"Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<paramname="cancellationToken">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberMemberName="GetResponsesAsync">
<MemberSignatureLanguage="C#"Value="public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<T>> GetResponsesAsync (System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig instance class System.Threading.Tasks.Task`1<class System.Collections.Generic.IReadOnlyCollection`1<!T>> GetResponsesAsync(valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignatureLanguage="DocId"Value="M:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1.GetResponsesAsync(System.Threading.CancellationToken)" />
<MemberSignatureLanguage="VB.NET"Value="Public Function GetResponsesAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of IReadOnlyCollection(Of T))" />
<MemberSignatureLanguage="F#"Value="member this.GetResponsesAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<'T>>"Usage="asyncCollectionRequestMessage.GetResponsesAsync cancellationToken" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<T>></ReturnType>
</ReturnValue>
<Parameters>
<ParameterName="cancellationToken"Type="System.Threading.CancellationToken" />
</Parameters>
<Docs>
<paramname="cancellationToken">A <seecref="T:System.Threading.CancellationToken" /> value to stop the operation.</param>
<summary>
Gets the collection of received response items.
</summary>
<returns>The collection of received response items.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberMemberName="Reply">
<MemberSignatureLanguage="C#"Value="public void Reply (Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<T>> response);" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig instance void Reply(class System.Func`2<valuetype System.Threading.CancellationToken, class System.Threading.Tasks.Task`1<!T>> response) cil managed" />
<MemberSignatureLanguage="DocId"Value="M:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1.Reply(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.Task{`0}})" />
<MemberSignatureLanguage="VB.NET"Value="Public Sub Reply (response As Func(Of CancellationToken, Task(Of T)))" />
<MemberSignatureLanguage="F#"Value="member this.Reply : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<'T>> -> unit"Usage="asyncCollectionRequestMessage.Reply response" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<ParameterName="response"Type="System.Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<T>>" />
</Parameters>
<Docs>
<paramname="response">The response to use to reply to the request message.</param>
<summary>
Replies to the current request message.
</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberMemberName="Reply">
<MemberSignatureLanguage="C#"Value="public void Reply (System.Threading.Tasks.Task<T> response);" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig instance void Reply(class System.Threading.Tasks.Task`1<!T> response) cil managed" />
<MemberSignatureLanguage="DocId"Value="M:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1.Reply(System.Threading.Tasks.Task{`0})" />
<MemberSignatureLanguage="VB.NET"Value="Public Sub Reply (response As Task(Of T))" />
<MemberSignatureLanguage="F#"Value="member this.Reply : System.Threading.Tasks.Task<'T> -> unit"Usage="asyncCollectionRequestMessage.Reply response" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<ParameterName="response"Type="System.Threading.Tasks.Task<T>" />
</Parameters>
<Docs>
<paramname="response">The response to use to reply to the request message.</param>
<summary>
Replies to the current request message.
</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<MemberMemberName="Reply">
<MemberSignatureLanguage="C#"Value="public void Reply (T response);" />
<MemberSignatureLanguage="ILAsm"Value=".method public hidebysig instance void Reply(!T response) cil managed" />
<MemberSignatureLanguage="DocId"Value="M:CommunityToolkit.Mvvm.Messaging.Messages.AsyncCollectionRequestMessage`1.Reply(`0)" />
<MemberSignatureLanguage="VB.NET"Value="Public Sub Reply (response As T)" />
<MemberSignatureLanguage="F#"Value="member this.Reply : 'T -> unit"Usage="asyncCollectionRequestMessage.Reply response" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>CommunityToolkit.Mvvm</AssemblyName>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<ParameterName="response"Type="T" />
</Parameters>
<Docs>
<paramname="response">The response to use to reply to the request message.</param>
<summary>
Replies to the current request message.
</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>